package com.myself.community.service;

import com.myself.community.entity.DiscussPost;
import com.myself.community.entity.SearchResult;
import org.springframework.stereotype.Service;


import java.io.IOException;

public interface ElasticSearchService {
    /**
     * 向Es服务器中新增帖子数据
     * @param post
     */
    public void saveDiscussPost(DiscussPost post);

    /**
     * Es服务器中根据id删除帖子
     * @param id
     */
    public void deleteDiscussPost(int id);

    /**
     * 搜索帖子
     * @param keyword
     * @param current
     * @param limit
     * @return
     */
    public SearchResult searchDiscussPost(String keyword, int current, int limit) throws IOException;
}
